package com.sdry.common;

/**
 * 通用命名
 * @author chenBin
 * @date 2020-3-2 14:08:37
 * @version 1.0
 */
public enum ContainerTypeEnum {
    //容器绑定代表在中转区时的库位为空
    WZZ_WRLID(BaseTypeEnum.WZZ.getCode(),null),
    //喷涂线和喷漆线（二遍漆）到成品库时装框
    CPK_WRLID(BaseTypeEnum.CPK.getCode(),-1L),
    //容器绑定代表在前处理区时的库位为 -2
    QCL_WRLID(BaseTypeEnum.QCL.getCode(),-2L),
    ;

    private String code;
    private Long name;
    ContainerTypeEnum(String code, Long name){
        this.code = code;
        this.name = name;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public Long getName() {
        return name;
    }
    public void setName(Long name) {
        this.name = name;
    }
    public static Long getNameByCode(String code){
        for (ContainerTypeEnum value : values()) {
            if(value.code.equals(code)){
                return value.name;
            }
        }
        //没有则返回null；
        return 0L;
    }
}
